<?php
error_reporting(~E_ALL & ~E_STRICT);
// get request data
$HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
if (!empty($HTTP_RAW_POST_DATA)) header('Content-Type: application/soap+xml; charset=utf8');

define('TMSVC_PATH', dirname(__FILE__).'/');
define('TMSVC_PATH_APP', TMSVC_PATH.'app/');
define('TMSVC_PATH_INFO', TMSVC_PATH.'info/');
define('TMSVC_PATH_LIB', TMSVC_PATH.'lib/');
define('TMSVC_PATH_TMP', TMSVC_PATH.'tmp/');

include TMSVC_PATH.'config.inc.php';

include TMSVC_PATH_LIB.'nusoap.php';

$server = new nusoap_server();
$server->xml_encoding = 'utf-8';
$server->soap_defencoding = 'UTF-8';
$server->configureWSDL(TMSVC_NAME, TMSVC_NAMESPACE);
$server->wsdl->schemaTargetNamespace = TMSVC_NAMESPACE;
// gathering functions
include TMSVC_PATH_TMP.'/'.TMSVC_NAME2.'.server.php';
// fRegisterFunctionsForDirectory($server, $config['functions.d']);
// fetching post data
// startup service
$server->service($HTTP_RAW_POST_DATA);